// 属性装饰器
function addDecorator(target: any, key: string) {
	console.log("target   ->", target);
	console.log("key      ->", key);
	// 给该属性在原型链中增加 _key 的属性
	Object.defineProperty(target, "_" + key, {
		writable: true,
		enumerable: true,
		configurable: true
	});
}

class Phone {
	@addDecorator
	name = "mm1";
}
const p1 = new Phone();
console.log(p1);//{name:'mm1'},__proto__:{_name:undefined}